import "plus-pro-components/es/components/search/style/css";
import type { PlusColumn } from "plus-pro-components";
import { getPickerShortcuts } from "@/utils/datePicker";

export const searchColumns: PlusColumn[] = [
  {
    label: "请求API",
    prop: "api",
    valueType: "input",
    fieldProps: {
      placeholder: "请输入请求API"
    }
  },
  {
    label: "状态",
    prop: "status",
    valueType: "select",
    options: [
      {
        label: "成功",
        value: "1"
      },
      {
        label: "失败",
        value: "0"
      }
    ],
    fieldProps: {
      placeholder: "请选择状态"
    }
  },
  {
    label: "状态码",
    prop: "status_code",
    valueType: "input",
    fieldProps: {
      placeholder: "请输入状态码"
    }
  },
  {
    label: "请求URL",
    prop: "url",
    valueType: "input",
    fieldProps: {
      placeholder: "请输入请求URL"
    }
  },
  {
    label: "参数",
    prop: "params",
    valueType: "input",
    fieldProps: {
      placeholder: "请输入参数"
    }
  },
  {
    label: "响应",
    prop: "response",
    valueType: "input",
    fieldProps: {
      placeholder: "请输入响应"
    }
  },
  {
    label: "创建时间",
    prop: "created_at",
    valueType: "date-picker",
    fieldProps: {
      type: "daterange",
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      valueFormat: "YYYY-MM-DD",
      shortcuts: getPickerShortcuts()
    }
  }
];
